<?php
	function findObject($arr){
		$class1="";
		$class2="";
		$br2=0;
		$lenght=count($arr);
		for ($i=0;$i<$lenght;$i++){
			if($i=0){
				$class1=get_class($arr[$i]);
				$br1=1;
			}
			else if($arr[$i] instanceof $class1){
				$br1++;
			}
			else 
				$class2=get_class($arr[$i]);
				$br2++;
		}
		if($br1>=$br2){
			$class=$class2;
		}
		else $class=$class1;
	
		foreach ($arr as $v){
  			if($v instanceof $class){
  				$BlackPeter=$v;
 			}
		}
		return $BlackPeter;
		}
	
	function showMethods($obj){
		$reflector = new ReflectionClass($obj);
			$method=$reflector->getMethods();
			foreach($method as $v){
				echo $v->name."<br/>";
			}
	}

?>